//
//  AnimationBlokViewController.swift
//  Animator
//
//  Created by liu guoqiang on 16/9/10.
//  Copyright © 2016年 liu guoqiang. All rights reserved.
//

import UIKit

class AnimationBlokViewController: UIViewController {
    @IBOutlet weak var ball: UIImageView!
    var flag = 1
    
  
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
       @IBAction func click(sender: AnyObject) {
        
        UIView.animateWithDuration(1.5) {
            var frame = self.ball.frame
            frame.origin.y += CGFloat(100 * self.flag)
            self.flag *= -1
            self.ball.frame = frame
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}
